from rest_framework import serializers
from question.models import *


class QuestionNewSerializer(serializers.ModelSerializer):
    labels = serializers.StringRelatedField()
    user = serializers.StringRelatedField()

    class Meta:
        model = Question
        fields = [
            'id',
            'createtime',
            'labels',
            'reply',
            'replyname',
            'replytime',
            'title',
            'unuseful_count',
            'useful_count',
            'user',
            'visits',
        ]
